//
//  LBJobInputHunterServiceTipsPopView.m
//  app
//
//  Created by 刘文扬 on 17/6/15.
//  Copyright © 2017年 NAICAI LI. All rights reserved.
//

#import "LBJobInputHunterServiceTipsPopView.h"
//#import "UIView+LBPopUp.h"
#import <Masonry/Masonry.h>
#import "NSString+LBString.h"
@interface LBJobInputHunterServiceTipsPopView ()

/** headBackgroundView*/
@property(nonatomic,strong)UIView *headBackgroundView;

/** imageView*/
@property(nonatomic,strong)UIImageView *imageView;

/** titleLabel*/
@property(nonatomic,strong)UILabel *titleLabel;

/** firstSubTitle*/
@property(nonatomic,strong)UILabel *firstSubTitleLabel;


/** secondSubTitle*/
@property(nonatomic,strong)UILabel *secondSubTitleLabel;

/** firstSortLabel*/
@property(nonatomic,strong)UILabel *firstSortLabel;

/** secondSortLabel*/
@property(nonatomic,strong)UILabel *secondSortLabel;

/** confirmButton*/
@property(nonatomic,strong)UIButton *confirmButton;


@end

@implementation LBJobInputHunterServiceTipsPopView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubviews];
        self.layer.masksToBounds = YES;
        self.layer.cornerRadius = 6;
    }
    return self;
}

-(void)confirmAction:(UIButton *)button
{
    //[self lb_hide];
}

-(void)initSubviews
{
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.headBackgroundView];
    [self.headBackgroundView addSubview:self.imageView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.firstSortLabel];
    [self addSubview:self.firstSubTitleLabel];
    [self addSubview:self.secondSortLabel];
    [self addSubview:self.secondSubTitleLabel];
    [self addSubview:self.confirmButton];
    
    [self.headBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.trailing.offset(0);
        make.height.equalTo(@164);
    }];
    
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.offset(0);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headBackgroundView.mas_bottom).offset(18);
        make.centerX.offset(0);
        make.trailing.offset(-30);
        make.leading.offset(30);
    }];
    
    [self.firstSubTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLabel.mas_bottom).offset(18);
        make.centerX.offset(0);
    }];
    
    [self.secondSubTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.firstSubTitleLabel.mas_bottom).offset(12);
        make.centerX.offset(0);
    }];
    
    [self.firstSortLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.firstSubTitleLabel);
        make.size.equalTo(@11);
        make.trailing.equalTo(self.firstSubTitleLabel.mas_leading).offset(-4.5);
    }];
    
    [self.secondSortLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.secondSubTitleLabel);
        make.size.equalTo(@11);
        make.trailing.equalTo(self.secondSubTitleLabel.mas_leading).offset(-4.5);
    }];
    
    [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.bottom.offset(0);
        make.height.equalTo(@60);
    }];
    
    
    
}
- (void)layoutSubviews{
    [super layoutSubviews];
    [self mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(300);
    }];
}
-(UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont boldSystemFontOfSize:14];
        label.textColor = [UIColor blackColor];
        label.numberOfLines = 0;
        _titleLabel = label;
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.text = @"尊贵的企业用户，感谢您使用联结招应聘猎头服务！";
        
    }
    return _titleLabel;
}

-(UILabel *)firstSubTitleLabel
{
    if (_firstSubTitleLabel == nil) {
        
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = [UIColor colorWithWhite:155.0f / 255.0f alpha:1.0f];
        label.numberOfLines = 1;
        _firstSubTitleLabel = label;
        _firstSubTitleLabel.text = @"请填写服务需求";
        
    }
    return _firstSubTitleLabel;
}

-(UILabel *)secondSubTitleLabel
{
    if (_secondSubTitleLabel == nil) {
        
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = [UIColor colorWithWhite:155.0f / 255.0f alpha:1.0f];
        label.numberOfLines = 1;
        _secondSubTitleLabel = label;
        _secondSubTitleLabel.attributedText = [NSString getAtrributedStringWithString:@"猎头顾问会在2个工作日内与您联系" subString:@"2个工作日" font:[UIFont systemFontOfSize:12] fontColor:[UIColor colorWithRed:252/255.0 green:58/255.0 blue:67/255.0 alpha:1.0]];
        
        
    }
    return _secondSubTitleLabel;
}

-(UILabel *)firstSortLabel
{
    if (_firstSortLabel == nil) {
        
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont systemFontOfSize:8];
        label.textColor = [UIColor whiteColor];
        label.numberOfLines = 1;
        _firstSortLabel = label;
        _firstSortLabel.layer.cornerRadius = 5.5;
        _firstSortLabel.layer.masksToBounds = YES;
        _firstSortLabel.textAlignment = NSTextAlignmentCenter;
        
        _firstSortLabel.backgroundColor = [UIColor colorWithRed:68/255.0 green:198/255.0 blue:77/255.0 alpha:1.0];
        _firstSortLabel.text = @"1";
        
    }
    return _firstSortLabel;
}

-(UILabel *)secondSortLabel
{
    if (_secondSortLabel == nil) {
        
        UILabel *label = [[UILabel alloc] init];
        label.font = [UIFont systemFontOfSize:8];
        label.textColor = [UIColor whiteColor];
        label.numberOfLines = 1;
        _secondSortLabel = label;
        _secondSortLabel.layer.cornerRadius = 5.5;
        _secondSortLabel.layer.masksToBounds = YES;
        _secondSortLabel.textAlignment = NSTextAlignmentCenter;
        _secondSortLabel.backgroundColor =[UIColor colorWithRed:68/255.0 green:198/255.0 blue:77/255.0 alpha:1.0];
        _secondSortLabel.text = @"2";
        
    }
    return _secondSortLabel;
}

-(UIView *)headBackgroundView
{
    if (_headBackgroundView == nil) {
        
        UIView *view = [[UIView alloc] init];
        
        view.backgroundColor = [UIColor colorWithRed:249/255.0 green:248/255.0 blue:253/255.0 alpha:1.0];
        _headBackgroundView = view;
    }
    return _headBackgroundView;
}

-(UIImageView *)imageView
{
    if (_imageView == nil) {
        
        UIImageView *imageView = [[UIImageView alloc] init];
        imageView.image = [UIImage imageNamed:@"填写服务需求弹窗"];
        _imageView = imageView;
        
    }
    return _imageView;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
